<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            margin: 200px;
        }

        span {
            display: inline-block;
            width: 40px;
            height: 40px;
            background-color: #333;
            font-size: 20px;
            color: #fff;
            text-align: center;
            line-height: 40px;
        }
    </style>
</head>
<body>
    <div>
        <span class="hour"></span>
        <span class="minute"></span>
        <span class="second"></span>
    </div>
    <script>
        var hour=document.querySelector('.hour');
        var minute=document.querySelector('.minute');
        var second=document.querySelector('.second');

        function djs(date){
            var date1=new Date();
            var date=new Date('2022-6-9-12:00:00');
            date=date.getTime();
            date1=date1.getTime();
            var sub=date-date1;
            sub=sub/1000;
            h=parseInt(sub/60/60%24);
            m=parseInt(sub/60%60);
            s=parseInt(sub%60);
            h=h<10?'0'+h:h;
            m=m<10?'0'+m:m;
            s=s<10?'0'+s:s;
            hour.innerHTML=h;
            minute.innerHTML=m;
            second.innerHTML=s;
            return h+':'+m+':'+s;
        }
        sj=new Date('2022-6-9-12:00:00');
        console.log(djs(sj));
        setInterval(() => {
            console.log(djs(sj));
        }, 1000);
    </script>
</body>
</html>